package com.swt.gap.model.dto;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class EventClassNewDTO {
    @JsonProperty("comments")
    private String comments;
    @JsonProperty("id")

    private String id;
    @JsonProperty("status")
    private String status;
    @JsonProperty("results")
    private ResultsDTO resultsX;

    @NoArgsConstructor
    @Data
    public static class ResultsDTO {
        @JsonProperty("author")
        private Object author;
        @JsonProperty("date")
        private Object date;
        @JsonProperty("pars")
        private List<ParsDTO> pars;
        @JsonProperty("pred_entity")
        private List<PredEntityDTO> predEntity;
        @JsonProperty("pred_event")
        private Object predEvent;
        @JsonProperty("pred_subject_event")
        private PredSubjectEventDTO predSubjectEvent;
        @JsonProperty("pred_time_space")
        private List<PredTimeSpaceDTO> predTimeSpace;
        @JsonProperty("source")
        private Object source;
        @JsonProperty("text")
        private String text;
        @JsonProperty("title")
        private Object title;
        @JsonProperty("url")
        private Object url;

        @NoArgsConstructor
        @Data
        public static class PredSubjectEventDTO {
            @JsonProperty("name")
            private String name;
            @JsonProperty("type")
            private String type;
        }

        @NoArgsConstructor
        @Data
        public static class ParsDTO {
            @JsonProperty("par_begin")
            private Integer parBegin;
            @JsonProperty("par_end")
            private Integer parEnd;
            @JsonProperty("sents")
            private List<SentsDTO> sents;

            @NoArgsConstructor
            @Data
            public static class SentsDTO {
                @JsonProperty("sent_begin")
                private Integer sentBegin;
                @JsonProperty("sent_end")
                private Integer sentEnd;
                @JsonProperty("text")
                private String text;
                @JsonProperty("words")
                private List<String> words;
            }
        }

        @NoArgsConstructor
        @Data
        public static class PredEntityDTO {
            @JsonProperty("entity_mentions")
            private List<EntityMentionsDTO> entityMentions;
            @JsonProperty("name")
            private String name;
            @JsonProperty("type")
            private String type;

            @NoArgsConstructor
            @Data
            public static class EntityMentionsDTO {
                @JsonProperty("begin")
                private Integer begin;
                @JsonProperty("doc_begin")
                private Integer docBegin;
                @JsonProperty("doc_end")
                private Integer docEnd;
                @JsonProperty("end")
                private Integer end;
                @JsonProperty("normalization")
                private String normalization;
                @JsonProperty("position")
                private List<Integer> position;
                @JsonProperty("text")
                private String text;
            }
        }

        @NoArgsConstructor
        @Data
        public static class PredTimeSpaceDTO {
            @JsonProperty("name")
            private String name;
            @JsonProperty("time_space_mentions")
            private List<TimeSpaceMentionsDTO> timeSpaceMentions;
            @JsonProperty("type")
            private String type;

            @NoArgsConstructor
            @Data
            public static class TimeSpaceMentionsDTO {
                @JsonProperty("begin")
                private Integer begin;
                @JsonProperty("doc_begin")
                private Integer docBegin;
                @JsonProperty("doc_end")
                private Integer docEnd;
                @JsonProperty("end")
                private Integer end;
                @JsonProperty("normalization")
                private String normalization;
                @JsonProperty("position")
                private List<Integer> position;
                @JsonProperty("text")
                private String text;
                @JsonProperty("time_stream")
                private Object timeStream;
            }
        }
    }
}
